home *** CD-ROM | disk | FTP | other *** search
/ PC World 2004 February / PCWorld_2004-02_cd.bin / software / vyzkuste / inno / isetup-4.0.10.exe / {app} / Examples / CodeDll.iss < prev    next >
Text File  |  2003-04-14  |  1KB  |  39 lines

  1. ; -- CodeDll.iss --
  2. ;
  3. ; This script shows how to call DLL functions at runtime from a [Code] section.
  4.  
  5. [Setup]
  6. AppName=My Program
  7. AppVerName=My Program version 1.5
  8. DefaultDirName={pf}\My Program
  9. DisableProgramGroupPage=yes
  10. UninstallDisplayIcon={app}\MyProg.exe
  11.  
  12. [Files]
  13. Source: "MyProg.exe"; DestDir: "{app}"
  14. Source: "MyProg.hlp"; DestDir: "{app}"
  15. Source: "Readme.txt"; DestDir: "{app}"; Flags: isreadme
  16. Source: "MyDll.dll"; Flags: dontcopy
  17.  
  18. [Code]
  19. const
  20.   MB_ICONINFORMATION = $40;
  21.  
  22. procedure MyDllFunc(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal);
  23. external 'MyDllFunc@files:MyDll.dll stdcall';
  24.  
  25. function MessageBox(hWnd: Integer; lpText, lpCaption: String; uType: Cardinal): Integer;
  26. external 'MessageBoxA@user32.dll stdcall';
  27.  
  28. function NextButtonClick(CurPage: Integer): Boolean;
  29. var
  30.   hWnd: Integer;
  31. begin
  32.   if CurPage = wpWelcome then begin
  33.     hWnd := StrToInt(ExpandConstant('{wizardhwnd}'));
  34.     MyDllFunc(hWnd, 'Hello from mydll.dll', 'MyDllFunc', MB_OK or MB_ICONINFORMATION);
  35.     MessageBox(hWnd, 'Hello from user32.dll', 'MessageBoxA', MB_OK or MB_ICONINFORMATION);
  36.   end;
  37.   Result := True;
  38. end;
  39.